# Application
list(APPEND LiteAppSrcDirs d:/workspace/cmake-test/src/Application)
# gui
list(APPEND LiteAppSrcDirs d:/workspace/cmake-test/src/GUI)
list(APPEND LiteAppSrcDirs d:/workspace/cmake-test/src/GUI/Text)
list(APPEND LiteAppSrcDirs d:/workspace/cmake-test/src/GUI/Painter)
list(APPEND LiteAppSrcDirs d:/workspace/cmake-test/src/GUI/Html)
list(APPEND LiteAppSrcDirs d:/workspace/cmake-test/src/GUI/Element)
# utility
list(APPEND LiteAppSrcDirs d:/workspace/cmake-test/src/Utility)
# blockly
list(APPEND LiteAppSrcDirs d:/workspace/cmake-test/src/Blockly)
list(APPEND LiteAppSrcDirs d:/workspace/cmake-test/src/Blockly/Field)
list(APPEND LiteAppSrcDirs d:/workspace/cmake-test/src/Blockly/FieldEditor)
list(APPEND LiteAppSrcDirs d:/workspace/cmake-test/src/Blockly/BlockEditor)
list(APPEND LiteAppSrcDirs d:/workspace/cmake-test/src/Blockly/BlockScript)
list(APPEND LiteAppSrcDirs d:/workspace/cmake-test/src/Blockly/UI)
# lua script
# list(APPEND LiteAppSrcDirs d:/workspace/cmake-test/src/LuaScript)

# javascript
list(APPEND LiteAppSrcDirs d:/workspace/cmake-test/src/JsScript)

# application
list(APPEND LiteAppSrcDirs d:/workspace/cmake-test/src/Platform/EspApplication)
list(APPEND LiteAppSrcDirs d:/workspace/cmake-test/app/BlockScript)
list(APPEND LiteAppSrcDirs d:/workspace/cmake-test/app/BlockScript/ComponentIDE)
# list(APPEND LiteAppSrcDirs d:/workspace/cmake-test/app/EspLiteApp)

list(APPEND LiteAppIncludeDirs d:/workspace/cmake-test/src/Interface)
list(APPEND LiteAppIncludeDirs d:/workspace/cmake-test/src/GUI/Interface)
list(APPEND LiteAppIncludeDirs d:/workspace/cmake-test/src/Platform)
list(APPEND LiteAppIncludeDirs d:/workspace/cmake-test/src/Blockly/Option)
list(APPEND LiteAppIncludeDirs d:/workspace/cmake-test/src/Blockly/Block)
list(APPEND LiteAppIncludeDirs d:/workspace/cmake-test/src/JsScript)
list(APPEND LiteAppIncludeDirs ${LiteAppSrcDirs})

# drivers
list(APPEND DRIVERS_SRC_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/drivers)
list(APPEND DRIVERS_SRC_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/drivers/lcd)
list(APPEND DRIVERS_SRC_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/drivers/i2c)
list(APPEND DRIVERS_SRC_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/drivers/touch)
list(APPEND DRIVERS_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/drivers)
list(APPEND DRIVERS_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/drivers/i2c)
list(APPEND DRIVERS_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/drivers/lcd)
list(APPEND DRIVERS_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/drivers/touch)

idf_component_register(
    SRC_DIRS "${CMAKE_CURRENT_SOURCE_DIR}" "${LiteAppSrcDirs}" "${DRIVERS_SRC_DIRS}" 
    INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}" "${LiteAppIncludeDirs}" "${DRIVERS_INCLUDE_DIRS}"
    REQUIRES "stb" "quickjs" "plutovg" "libzip" "protocol_examples_common" "esp_common" "nvs_flash" "spiffs" "esp_eth" "esp_netif" "esp_wifi" "esp_http_client" "esp_http_server" "esp_https_ota" "app_update" "esp_lcd" "bt" "mbedtls"
)

# EMBED_FILES "SourceHanSansSC_Normal_Min.ttf"
# EMBED_FILES "test.txt"
# EMBED_FILES "DroidSansMono.ttf"
# EMBED_FILES "DroidSansFallback.ttf"
# 

target_compile_definitions(${COMPONENT_LIB} PUBLIC PLATFORM_ESP USE_GUI USE_BLOCKLY USE_PLUTOVG USE_JS_SCRIPT USE_LIBZIP USE_ZLIB)
target_compile_options(${COMPONENT_LIB} PUBLIC -Wno-unused-variable -Wno-uninitialized -Wno-maybe-uninitialized -Wno-unused-but-set-parameter -Wno-ignored-qualifiers -Wno-missing-field-initializers -Wno-delete-non-virtual-dtor -fpermissive -Wno-error=unused-local-typedefs)

# file(COPY D:/workspace/cmake-test/app/BlockScript/assets/components/示例.cbs.xml DESTINATION D:/workspace/esp/esp-lite-app/assets/components/test.cbs.xml)
spiffs_create_partition_image(storage ../assets FLASH_IN_PROJECT)
# spiffs_create_partition_image(storage D:/workspace/cmake-test/assets FLASH_IN_PROJECT)


